/**
 * 招聘过程API
 */

import request from '@/utils/request'

/**
 * 招聘过程列表
 * @param {*} data
 * @returns
 */
export function hrmRecruitProcesQueryListAPI(data) {
  return request({
    url: 'hrmRecruitProces/queryRecruitProcesPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 招聘过程详情
 * @param {*} procesId
 * @returns
 */
export function hrmRecruitProcesQueryByIdAPI(procesId) {
  return request({
    url: `hrmRecruitProces/queryById/${procesId}`,
    method: 'post'
  })
}

/**
 * 新增招聘过程
 * @param {*} data
 * @returns
 */
export function hrmRecruitProcesAddAPI(data) {
  return request({
    url: 'hrmRecruitProces/addRecruitProces',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 修改招聘过程
 * @param {*} data
 * @returns
 */
export function hrmRecruitProcesSetAPI(data) {
  return request({
    url: 'hrmRecruitProces/setRecruitProces',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 删除招聘过程
 * @param {*} data
 * @returns
 */
export function hrmRecruitProcesDeleteAPI(data) {
  return request({
    url: 'hrmRecruitProces/batchDeleteRecruitProces',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 导出招聘过程
 * @param {*} data
 * @returns
 */
export function hrmRecruitProcesExportAPI(data) {
  return request({
    url: 'hrmRecruitProces/exportRecruitProces',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    responseType: 'blob'
  })
}

/**
 * 招聘过程导入模板
 */
export function procesImportTemplateAPI() {
  return request({
    url: 'hrmRecruitProces/downloadExcel',
    method: 'post',
    responseType: 'blob'
  })
}

/**
 * 招聘过程Excel导入
 */
export function procesExcelImportAPI(data) {
  const formData = new FormData()
  formData.append('file', data.file)
  return request({
    url: 'hrmRecruitProces/excelImport',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

/**
 * 上报招聘过程
 */
export function hrmRecruitProcesReportAPI() {
  return request({
    url: 'hrmRecruitPlan/syncRecruitProces',
    method: 'post'
  })
}

